#ifndef __H_GLOBAL_DEFINE_H__
#define __H_GLOBAL_DEFINE_H__

#include <string>
#include <map>
#include <vector>


class CacheConf
{
public:
	CacheConf()
	{
		reset();
	}
	~CacheConf(){};
	void reset()
	{
		name = ip = "";
		port = 0;
	}
	std::string name;
	std::string ip;
	int port;
};
typedef std::map<std::string, CacheConf*> CacheConfList;


class DBConf
{
public:
	DBConf()
	{
		reset();
	}
	~DBConf(){};
	void reset()
	{
		name = ip = "";
		db_name = user = passwd = "";
		port = 0;
	}

	std::string name;
	std::string db_name;
	std::string ip;
	int port;
	std::string user;
	std::string passwd;
};
typedef std::map<std::string, DBConf*> DBConfList;

class CClientHandler;
class ServerData
{
public:
	ServerData()
	{
		reset();
	}
	~ServerData(){}

	void reset()
	{
		type = 0;
		svid = 0;
		ip = "";
		port = 0;
		param1 = param2 = param3 = 0;
		param_str = "";
		pHandler = NULL;
	}

	int type;
	int svid;
	std::string ip;
	int port;
	int param1;
	int param2;
	int param3;
	std::string param_str;
	CClientHandler* pHandler;
};
typedef std::vector<ServerData*> SrvDataVector;
typedef std::map<int, ServerData*> SrvDataList;
typedef std::map<int, SrvDataList> SrvTypeList;

class ServerConf
{
public:
	ServerConf(){ reset(); };
	int svid;
	char ip[32];
	int port;
	int level;
	void reset()
	{
		memset(this, 0, sizeof(ip));
		port = svid = level = 0;
	}
};


#endif